package service;

import java.util.Map;

import dao.ActedDAO;
import dao.ActorDAO;
import dao.WorkedAsCrewDAO;
import domain.Actor;
import domain.ActorJob;
import domain.CrewJob;
import domain.User;
import ex.DatabaseException;

public class WorkService {
	ActedDAO aDao=new ActedDAO();
	WorkedAsCrewDAO wDao=new WorkedAsCrewDAO();
	public void addActed(User user,ActorJob aj) throws DatabaseException{
		aDao.insertActed(user,aj);
	}
	public void acceptApply(User user,ActorJob aj) throws DatabaseException{
		aDao.acceptApply(user,aj);
	}
	public void rejectApply(User user,ActorJob aj) throws DatabaseException{
		aDao.rejectApply(user,aj);
	}
	
	public void addWorkedAsCrew(User user,CrewJob cj) throws DatabaseException{
		wDao.insertWorkedAsCrew(user,cj);
	}
	public void acceptApply(User user,CrewJob cj) throws DatabaseException{
		wDao.acceptApply(user, cj);
	}
	public void rejectApply(User user,CrewJob cj) throws DatabaseException{
		wDao.rejectApply(user, cj);
	}
	
	public Map<User,Integer> getActedUsersByAjid(long ajid) throws DatabaseException{
		return aDao.selectActedUsersByAjid(ajid);
	}
	public Map<User, Integer> getWorkedAsCrewUsersByCjid(long cjid) throws DatabaseException {
		return wDao.selectWorkedUsersByCjid(cjid);
	}
}
